import { request } from '@/plugins/request'

// 获取文章详情

export const getArticlesinfo = slug =>
  request({
    url: `/api/articles/${slug}`,
    method: 'get'
  })

  // 获取文章评论

export const getComments = slug =>
request({
  url: `/api/articles/${slug}/comments`,
  method: 'get'
})

// 添加
export const addComments = (slug, data) =>
request({
  url: `/api/articles/${slug}/comments`,
  method: 'post',
  data
})

// 删除
export const delComments = (slug, id) =>
request({
  url: `/api/articles/${slug}/comments/${id}`,
  method: 'delete'
})
